<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05_JS的运算符</title>
</head>
<body>
   <script>
       //除法运算直接得到直接数字结果，不会舍弃小数点
       console.log(6/2);//3
       console.log(9/2);//4.5


       let a=1;
       let b=true;
       //JS比较运算符的任意一侧如果有数字，会把另一边先转为数字，在比较
       //== 松散比较运算符，只比较是否相等
       console.log(a==b);
       //=== 严格比较运算符会比较类型和值，会先比较类型，再比较值
       console.log(a===b);

       console.log(3>10);//false
       console.log("3">10);//false
       console.log(3>"10");//false

       console.log('超'>'宇');//true
       //charCodeAt() 获取字符的ASCII码,取第一个数字的ASCII码
       console.log('超'.charCodeAt());
       console.log('宇'.charCodeAt());
       console.log('10086'.charCodeAt());//49
       console.log('10086'.charCodeAt(4));//54
       console.log('1'.charCodeAt());//49
       console.log('6'.charCodeAt());//54

       console.log('3'>'10');//true
       console.log('3'.charCodeAt());//51
       console.log('10'.charCodeAt());//49

       let c = 0;
       console.log(c==0 ?'yes':'no');//yes
       //=是赋值符号，先把c赋值为0，在把0转为布尔值，对于三元运算符 ,false 为 no
       console.log(c=0 ?'yes':'no');//no





   </script>
</body>
</html>